home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / misc / unix / tracker_4_3.lzh / tracker / Amiga / amiga.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  3.6 KB  |  154 lines

  1. /* amiga/amiga.h 
  2.     vi:se ts=3 sw=3:
  3.  */
  4.  
  5. /* $Id: amiga.h,v 1.15 1994/01/09 04:49:18 Espie Rel Espie $
  6.  * $Log: amiga.h,v $
  7.  * Revision 1.15  1994/01/09  04:49:18  Espie
  8.  * File requester !
  9.  *
  10.  * Revision 1.14  1994/01/08  20:26:07  Espie
  11.  * Added pause gadget.
  12.  *
  13.  * Revision 1.13  1994/01/08  19:45:29  Espie
  14.  * Uncentralized event handling using event management functions.
  15.  *
  16.  * Revision 1.12  1994/01/07  15:08:54  Espie
  17.  * Scroller back calls.
  18.  *
  19.  * Revision 1.11  1994/01/06  22:37:26  Espie
  20.  * Trivial change.
  21.  *
  22.  * Revision 1.10  1994/01/05  19:24:08  Espie
  23.  * Fully working asynchronous interface.
  24.  *
  25.  * Revision 1.9  1994/01/05  16:48:58  Espie
  26.  * Protos for client.c functions.
  27.  *
  28.  * Revision 1.8  1994/01/05  16:12:06  Espie
  29.  * Problem with output ? Still to fix !
  30.  *
  31.  * Revision 1.7  1994/01/05  14:55:38  Espie
  32.  * *** empty log message ***
  33.  *
  34.  * Revision 1.6  1993/12/28  14:03:53  Espie
  35.  * new TYPE_SYNC_DO.
  36.  * Protos for obtain_message, send.
  37.  *
  38.  */
  39.  
  40. #define forever for(;;)
  41.  
  42. /* list scanning.
  43.  * next is needed: with it, we can actually unlink the node while scanning
  44.  * the current list.  Type is provided to avoid type-casting errors in
  45.  * SCANLIST expansion.
  46.  */
  47. #define SCANLIST(node, next, list, type) \
  48.    for((node) = (type)((struct MinList *)(list))->mlh_Head; \
  49.       (next) = (type)((struct MinNode *)(node))->mln_Succ; \
  50.       (node) = (next))
  51.  
  52.  
  53. #define PUBLIC_PORT_NAME "Debug this tracker"
  54.  
  55. /* number of messages to allocate */
  56. #define BUFFER_SIZE 500
  57. /* (total size: 500 * 32 = 16000 bytes, corresponding to roughly
  58.  * 1.5 second */
  59.  
  60. struct ext_message
  61.    {
  62.    struct Message msg;
  63. #define TYPE_DIE 0
  64. #define TYPE_WAIT 1
  65. #define TYPE_FLUSH_CHANNEL 2
  66. #define TYPE_SETUP 3
  67. #define TYPE_CHANGE 4
  68. #define TYPE_FLUSH_BUFFER 5
  69. #define TYPE_COMM 6
  70. #define TYPE_SYNC 7
  71. #define TYPE_SYNC_DO 8
  72. #define TYPE_INVALID 9
  73. #define TYPE_PAUSE 10
  74. #define TYPE_UNPAUSE 11
  75.  
  76.    int type;
  77.    union
  78.       {
  79.       struct
  80.          {
  81.          void (*func)(VALUE p);
  82.          VALUE p;
  83.          } hook;
  84.       struct 
  85.          {
  86.          ULONG high;
  87.          ULONG low;
  88.          } time;
  89.       struct
  90.          {
  91.          void *start;
  92.          ULONG length;
  93.          } sample;
  94.       struct
  95.          {
  96.          USHORT channel_mask;
  97.          USHORT cycle;
  98.          USHORT pitch;
  99.          USHORT volume;
  100.          } info;
  101.       struct
  102.          {
  103.          struct MsgPort *port;
  104.          struct Task *task;
  105.          } comm;
  106.       } data;
  107.    };
  108.  
  109.  
  110. /* the audio server entry point */      
  111. XT void subtask P((struct ext_message *msg));
  112.  
  113. /* Standard functions of the client */
  114.  
  115. /* mes = obtain_message():
  116.  *    obtain a message we can send to the server
  117.  *    (this call may block, but usually not for long)
  118.  */
  119. XT struct ext_message *obtain_message P((void));
  120.  
  121. /* mes = await_type(type):
  122.  *    wait for the return of the next message of a given type
  123.  *    and returns it. Synchronization with the server.
  124.  */
  125. XT struct ext_message *await_type P((int type));
  126.  
  127. /* send(msg, type):
  128.  *    send msg to the server, filling type along the way
  129.  */
  130. XT void send P((struct ext_message *msg, int type));
  131.  
  132.  
  133. XT void add_scroller P((char *s));
  134.  
  135. XT void set_break(void);
  136. XT void check_events(void);
  137. XT void await_events(void);
  138. XT void install_signal_handler(int signal, void (*f)(GENERIC data), GENERIC data);
  139. XT void remove_signal_handler(int signal);
  140. XT void install_req_handler(ULONG mask, void (*req_f)(ULONG received));
  141. XT void remove_req_handler(void);
  142.  
  143. struct amiganame
  144.    {
  145.    struct MinNode n;
  146.    boolean i;
  147.    char s[0];  
  148.    };
  149.  
  150. /* prototypes for the file requester */
  151.  
  152. XT void launch_requester P((void));
  153. XT void requested_file P((struct amiganame *name));
  154.